﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NightskyMimic.Domain
{
    public class Creature : Card
    {
        private static int count = 1;

        public int Power { get; set; }

        public int Toughness { get; set; }

        public int Id { get; private set; }

        public Double CastCoefficient 
        {
            get { return (Power + Toughness) / ManaCost; }
        } 

        public Creature(string name, int manaCost, int power, int toughness) 
            :base(name, manaCost)
        {
            Tapped = false;
            Power = power;
            Toughness = toughness;
            Id = count;
            count++;
        }

        public override bool Equals(object obj)
        {
            if (!(obj is Creature))
                return false;

            return this.Id == (obj as Creature).Id;
        }

        public override int GetHashCode()
        {
            return Id;
        }

        public override string ToString()
        {
            return Name + "(" + Power + "/" + Toughness + ")";
        }
    }
}